package org.example.controller;

import org.example.service.IStudentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/student")
public class StudentController {
    @Autowired
    private IStudentService studentService;

    /**
     * 更新学员总分接口
     * @param studentId
     * @param changescore
     * @return
     */
    @RequestMapping("/updateStudentScore")
    @ResponseBody
    public String updateStudentScore(@RequestParam("studentId") int studentId, @RequestParam("changescore") int changescore){
        studentService.updateStudentScore(studentId, changescore);
        return "updateStudentScore success";
    }
}
